<template>
  <a-form :form="form" layout="vertical" class="rx-a-form-vertical" >

    <a-form-item class="aselectTime" :label="i18n('form.dataFormat','日期格式')">
      <a-select style="width: 90%" allowClear :placeholder="i18n('form.dataFormat','日期格式')"  v-decorator="['format',{initialValue:'yyyy-MM-dd'}]" :options="dateFormats"></a-select>
    </a-form-item>

  </a-form>
</template>

<script>
    export default {
      name: "renderConfig_date",
      props:["layerid","destroy"],
      data(){
        return {
          labelCol: { span:6 },
          wrapperCol: { span:18 },
          labelCol1: { span:3 },
          wrapperCol1: { span:19 },
          form: this.$form.createForm(this),
          mdl:{},
          dateFormats:[{label:'YYYY-MM-DD',value:'YYYY-MM-DD'},
            {label:'YYYY-MM-DD HH:mm:ss',value:'YYYY-MM-DD HH:mm:ss'},
            {label:'YYYY-MM-DD HH:mm',value:'YYYY-MM-DD HH:mm'},
            {label:'YYYY-MM',value:'YYYY-MM'},
            {label:'HH:mm',value:'HH:mm'},
            {label:'HH:mm:ss',value:'HH:mm:ss'}]
        }
      },
      methods:{
          i18n(name,text,key){
              return this.$ti18(name,text,"formCellRender",key);
          },
        setData(data,fieldDts){
          this.mdl=data;
          this.form.setFieldsValue(this.mdl);
        },
        validate(callback){
          var self=this;
          this.form.validateFields((err, values) => {
            if(err){
              return;
            }
            self.mdl=values;
            callback();
          });
        },
        getData(){
          this.mdl.dataType="date";
          this.mdl.dataType_name=this.i18n('form.dateType','日期型');
          return this.mdl;
        },
        changeData(e,field){
          this.mdl[field]=e.target.checked;
        }
      }
    }
</script>

<style scoped>
.aselectTime{
    width: 90%;
}
</style>